package com.zy.mapper;

import com.zy.entity.Carousel;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author LittleDesire
 * @description
 * @date 2022-04-02 周六 17:44
 * @since 17
 */
@Service
public interface CarouselMapper {
    @Select("select * from t_carousel")
    List<Carousel> queryAll();
    @Select("select * from t_carousel where isshow")
    List<Carousel> show();

    @Update("update t_carousel set isshow=#{v} where id=#{id}")
    int updateIsShow(@Param("v") int v, @Param("id") int id);

    @Delete("delete from t_carousel where id=#{id}")
    int deleteById(int id);

    @Insert("insert into t_carousel(title, src, link,isshow) value (#{title},#{src},#{link},#{isshow})")
    int save(Map<String, Object> map);
}
